#include "baseCTF.h"

using namespace std;


void GridPos::serialize(ostream& ostr) const
{
	ostr << boolalpha << valid;
	if (valid)
		ostr << ' ' << x << ' ' << y;
}

void GridPos::unserialize(istream& istr)
{
	istr >> boolalpha >> valid;
	if (valid)
		istr >> x >> y;
}


void Turn::serialize(ostream& ostr) const
{
	ostr << playerID;
	if (PLAYERID_SERVER != playerID)
		ostr << ' ' << turnID;
}

void Turn::unserialize(istream& istr)
{
	istr >> playerID;
	if (PLAYERID_SERVER != playerID)
		istr >> turnID;
}
